package com.sokal.easycare.modules.payment.entity;


import java.util.Date;
import java.util.Map;

import com.sokal.easycare.common.persistence.DataEntity;

/**
 * @Title 支付宝支付回调记录
 * @author zhoutian   
 * @date 2015-11-26
 */
public class OrderAlipayCallbackRecord extends DataEntity<OrderAlipayCallbackRecord> {
	
	private static final long serialVersionUID = 1L;
	//商户系统唯一订单号
	private String orderno;
	//通知时间
	private String notifytime;
	//用户id
	private String userid;
	//类型
	private String thirdpartytype;
	//通知类型：异步通知、同步通知
	private String notifytype;
	//通知校验ID，用于验证该回调请求是该方发出
	private String notifyid;
	//签名方式,固定取值为RSA
	private String signtype;
	//签名,用于验证回调请求参数是否被篡改过
	private String sign;
	//商品名称
	private String subject;
	//支付类型,默认值为：1（商品购买）
	private String paymenttype;
	//支付宝交易号
	private String tradeno;
	//交易状态码
	private String tradestatus;
	//商户编号，商户（电桩）在第三方支付平台上开设的商户号码
	private String partnerno;
	//卖家(商户)支付宝账号
	private String selleremail;
	//买家支付宝用户号
	private String buyerid;
	//买家支付宝账号，可以是Email或手机号码
	private String buyeremail;
	//交易金额
	private String totalfee;
	//购买数量
	private String quantity;
	//商品单价,price等于total_fee
	private String price;
	//商品描述,该笔订单的备注、描述、明细等。对应请求时的body参数，原样通知回来
	private String orderdesc;
	//该笔交易创建的时间。格式为yyyy-MM-dd HH:mm:ss
	private String gmtcreate;
	//该笔交易的买家付款时间。格式为yyyy-MM-dd HH:mm:ss
	private String gmtpayment;
	//该交易是否调整过价格
	private String istotalfeeadjust;
	//买家是否在交易过程中使用了红包
	private String usecoupon;
	//折扣，支付宝系统会把discount的值加到交易金额上，如果有折扣，本参数为负数，否则为0.00,单位为元
	private String discount;
	//退款状态,REFUND_SUCCESS: 退款成功
	//全额退款情况：trade_status= TRADE_CLOSED，而refund_status=REFUND_SUCCESS；
	//非全额退款情况：trade_status= TRADE_SUCCESS，而refund_status=REFUND_SUCCESS
	//REFUND_CLOSED: 退款关闭
	private String refundstatus;
	//退款时间,卖家退款的时间，退款通知时会发送。格式为yyyy-MM-dd HH:mm:ss
	private String gmtrefund;
	//创建时间
	private Date createdate;
	             
	public OrderAlipayCallbackRecord(){
		
	}
	public OrderAlipayCallbackRecord(Map<String,String> params) {
		this.orderno = params.get("out_trade_no");
		this.userid = params.get("userid");
		this.thirdpartytype = params.get("thirdpartytype");
		this.notifytime = params.get("notify_time");
		this.notifytype = params.get("notify_type");
		this.notifyid = params.get("notify_id");
		this.signtype = params.get("sign_type");
		this.sign = params.get("sign");
		this.subject = params.get("subject");
		this.paymenttype = params.get("payment_type");
		this.tradeno = params.get("trade_no");
		this.tradestatus = params.get("trade_status");
		this.partnerno = params.get("seller_id");
		this.selleremail = params.get("seller_email");
		this.buyerid = params.get("buyer_id");
		this.buyeremail = params.get("buyer_email");
		this.totalfee = params.get("total_fee");
		this.quantity = params.get("quantity");
		this.price = params.get("price");
		this.orderdesc = params.get("body");
		this.gmtcreate = params.get("gmt_create");
		this.gmtpayment = params.get("gmt_payment");
		this.istotalfeeadjust = params.get("is_total_fee_adjust");
		this.usecoupon = params.get("use_coupon");
		this.discount = params.get("discount");
		this.refundstatus = params.get("refund_status");
		this.gmtrefund = params.get("gmt_refund");
		this.createdate = new Date();
	}
	
	public String getThirdpartytype() {
		return thirdpartytype;
	}
	public void setThirdpartytype(String thirdpartytype) {
		this.thirdpartytype = thirdpartytype;
	}
	public String getUserid() {
		return userid;
	}
	public void setUserid(String userid) {
		this.userid = userid;
	}
	public String getOrderno() {
		return orderno;
	}
	public void setOrderno(String orderno) {
		this.orderno = orderno;
	}
	public String getNotifytime() {
		return notifytime;
	}
	public void setNotifytime(String notifytime) {
		this.notifytime = notifytime;
	}
	public String getNotifytype() {
		return notifytype;
	}
	public void setNotifytype(String notifytype) {
		this.notifytype = notifytype;
	}
	public String getNotifyid() {
		return notifyid;
	}
	public void setNotifyid(String notifyid) {
		this.notifyid = notifyid;
	}
	public String getSigntype() {
		return signtype;
	}
	public void setSigntype(String signtype) {
		this.signtype = signtype;
	}
	public String getSign() {
		return sign;
	}
	public void setSign(String sign) {
		this.sign = sign;
	}
	public String getSubject() {
		return subject;
	}
	public void setSubject(String subject) {
		this.subject = subject;
	}
	public String getPaymenttype() {
		return paymenttype;
	}
	public void setPaymenttype(String paymenttype) {
		this.paymenttype = paymenttype;
	}
	public String getTradeno() {
		return tradeno;
	}
	public void setTradeno(String tradeno) {
		this.tradeno = tradeno;
	}
	public String getTradestatus() {
		return tradestatus;
	}
	public void setTradestatus(String tradestatus) {
		this.tradestatus = tradestatus;
	}
	public String getPartnerno() {
		return partnerno;
	}
	public void setPartnerno(String partnerno) {
		this.partnerno = partnerno;
	}
	public String getSelleremail() {
		return selleremail;
	}
	public void setSelleremail(String selleremail) {
		this.selleremail = selleremail;
	}
	public String getBuyerid() {
		return buyerid;
	}
	public void setBuyerid(String buyerid) {
		this.buyerid = buyerid;
	}
	public String getBuyeremail() {
		return buyeremail;
	}
	public void setBuyeremail(String buyeremail) {
		this.buyeremail = buyeremail;
	}
	public String getTotalfee() {
		return totalfee;
	}
	public void setTotalfee(String totalfee) {
		this.totalfee = totalfee;
	}
	public String getQuantity() {
		return quantity;
	}
	public void setQuantity(String quantity) {
		this.quantity = quantity;
	}
	public String getPrice() {
		return price;
	}
	public void setPrice(String price) {
		this.price = price;
	}
	public String getOrderdesc() {
		return orderdesc;
	}
	public void setOrderdesc(String orderdesc) {
		this.orderdesc = orderdesc;
	}
	public String getGmtcreate() {
		return gmtcreate;
	}
	public void setGmtcreate(String gmtcreate) {
		this.gmtcreate = gmtcreate;
	}
	public String getGmtpayment() {
		return gmtpayment;
	}
	public void setGmtpayment(String gmtpayment) {
		this.gmtpayment = gmtpayment;
	}
	public String getIstotalfeeadjust() {
		return istotalfeeadjust;
	}
	public void setIstotalfeeadjust(String istotalfeeadjust) {
		this.istotalfeeadjust = istotalfeeadjust;
	}
	public String getUsecoupon() {
		return usecoupon;
	}
	public void setUsecoupon(String usecoupon) {
		this.usecoupon = usecoupon;
	}
	public String getDiscount() {
		return discount;
	}
	public void setDiscount(String discount) {
		this.discount = discount;
	}
	public String getRefundstatus() {
		return refundstatus;
	}
	public void setRefundstatus(String refundstatus) {
		this.refundstatus = refundstatus;
	}
	
	public String getGmtrefund() {
		return gmtrefund;
	}
	public void setGmtrefund(String gmtrefund) {
		this.gmtrefund = gmtrefund;
	}
	public Date getCreatedate() {
		return createdate;
	}
	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}
	
}
